import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '模式编码',
    align:"center",
    dataIndex: 'modeCode'
   },
   {
    title: '模式名称',
    align:"center",
    dataIndex: 'modeName'
   },
   {
    title: '考核类型',
    align:"center",
    dataIndex: 'assessType'
   },
   {
    title: '接口模式',
    align:"center",
    dataIndex: 'modeInterface'
   },
   {
    title: '描述',
    align:"center",
    dataIndex: 'descr'
   },
   {
    title: '排序',
    align:"center",
    dataIndex: 'displayOrder'
   },
   {
    title: '创建人',
    align:"center",
    dataIndex: 'sysCreatorId'
   },
   {
    title: '创建日期',
    align:"center",
    dataIndex: 'sysCreateDate'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '模式编码',
    field: 'modeCode',
    component: 'Input',
  },
  {
    label: '模式名称',
    field: 'modeName',
    component: 'Input',
  },
  {
    label: '考核类型',
    field: 'assessType',
    component: 'Input',
  },
  {
    label: '接口模式',
    field: 'modeInterface',
    component: 'Input',
  },
  {
    label: '描述',
    field: 'descr',
    component: 'InputTextArea',
  },
  {
    label: '排序',
    field: 'displayOrder',
    component: 'InputNumber',
  },
  {
    label: '创建人',
    field: 'sysCreatorId',
    component: 'Input',
  },
  {
    label: '创建日期',
    field: 'sysCreateDate',
    component: 'DatePicker',
    componentProps: {
       showTime: true,
       valueFormat: 'YYYY-MM-DD HH:mm:ss'
     },
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];

// 高级查询数据
export const superQuerySchema = {
  modeCode: {title: '模式编码',order: 0,view: 'text', type: 'string',},
  modeName: {title: '模式名称',order: 1,view: 'text', type: 'string',},
  assessType: {title: '考核类型',order: 2,view: 'text', type: 'string',},
  modeInterface: {title: '接口模式',order: 3,view: 'text', type: 'string',},
  descr: {title: '描述',order: 4,view: 'textarea', type: 'string',},
  displayOrder: {title: '排序',order: 5,view: 'number', type: 'number',},
  sysCreatorId: {title: '创建人',order: 6,view: 'text', type: 'string',},
  sysCreateDate: {title: '创建日期',order: 7,view: 'datetime', type: 'string',},
  sysUpdatorId: {title: '修改人',order: 8,view: 'text', type: 'string',},
  sysUpdateDate: {title: '修改日期',order: 9,view: 'datetime', type: 'string',},
  sysDeptId: {title: '归属部门标识',order: 10,view: 'text', type: 'string',},
  sysCompanyId: {title: '归属单位标识',order: 11,view: 'text', type: 'string',},
};

/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}